let s:ollama = {}
function! s:ollama.list_models(host) abort
    let l:url = a:host .. "/api/tags"
    let l:response = api#pyenv#request("get", py3eval("vim.eval('l:url')"), {})
    if l:response.status_code == 200
        let l:json = json_decode(l:response.content)
    else
        let l:json = []
    endif
    return l:json
endfunction

echo s:ollama.list_models(g:ollama_host)

function! api#ollama#init() abort
    return deepcopy(s:ollama)
endfunction
